<?php
/**
 * Description:
 *
 * @author      Eden
 * @datetime    2017/2/11 17:41
 * @copyright   WuHan HuQi Technology Co.,Ltd.
 * @url         http://cnhuqi.com
 */

class Admin_Model extends CI_Model
{
    /**
     * 初始化
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 获取管理员信息
     * @param array $ids
     * @return array
     */
    public function getAdminsByIds(Array $ids)
    {
        if (empty($ids)) {
            return [];
        }
        $db = clone($this->db);
        $db->where_in('id', $ids);
        $query = $db->get('admin');
        $rows = $query->result_array();
        $data = [];
        if (!empty($rows)) foreach($rows as $item) {
            $data[$item['id']] = $item['nickName'];
        }
        return $data;
    }
}
